package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TypeVO implements Serializable {
    private Integer id; //编号
    private String nickname; //昵称
    private String avatar; //用户头像
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String education; //学历
    private Integer marriage; //婚姻状态

    //匹配度
    private  Integer matchRate;
    //是否喜欢
    private boolean alreadyLove;


    /**
     * 在vo对象中，补充一个工具方法，封装转化过程
     */
    public static TypeVO init(UserInfo userInfo) {
        TypeVO vo = new TypeVO();
        BeanUtils.copyProperties(userInfo,vo);
        return vo;
    }
}
